<include file="public@header"/>
</head>
<body>
<div class="wrap">
    <ul class="nav nav-tabs">
        <li class="active"><a href="{:url('sign_up/index')}">报名课程列表</a></li>
        <li><a href="{:url('sign_up/add')}">新增报名课程</a></li>
    </ul>
    <form class="well form-inline margin-top-20" method="post" action="{:url('sign_up/index')}">
        关键字：
        <input class="form-control" type="text" name="title" style="width: 200px;" value="{:input('request.title')}" placeholder="报名课程名称">
        所属课程:
        <select class="form-control" type="text" name="course_id">
            <option value=""></option>
            <foreach name="course_list" item="vo">
                <option value="{$vo.id}" <if $vo.id == input('course_id')>selected</if> >{$vo.title}</option>
            </foreach>
        </select>
        <input type="submit" class="btn btn-primary" value="搜索"/>
        <a class="btn btn-danger" href="{:url('sign_up/index')}">清空</a>
    </form>
    <form method="post" class="js-ajax-form">
        <table class="table table-hover table-bordered">
            <thead>
            <tr>
                <th>ID</th>
                <th>报名课程名称</th>
                <th>所属课程</th>
                <th>届次</th>
                <th>报名时间</th>
                <th>培训时间</th>
                <th width="200">培训信息</th>
                <th>开课人数</th>
                <th>性别限制</th>
                <th>年龄范围</th>
                <th>报名费用</th>
                <th>报名状态</th>
                <th>已报名人数</th>
                <th>开课状态</th>
                <th>{:lang('ACTIONS')}</th>
            </tr>
            </thead>
            <tbody>
            <foreach name="list" item="vo">
                <tr>
                    <td>{$vo.id}</td>
                    <td>{$vo.title}</td>
                    <td>{$vo.course.title}</td>
                    <td>{$vo.session}</td>
                    <td>
                        <if $vo.first>
                            老学员优先：<br>{$vo.first_start_time}<br>新生：<br>
                        <else/>
                            统一报名：<br>
                        </if>
                        {$vo.sign_up_start_time}
                        <br>~<br>
                        {$vo.sign_up_end_time}
                    </td>
                    <td>
                        {$vo.train_start_time}
                        <br>~<br>
                        {$vo.train_end_time}
                    </td>
                    <td>
                        地址：{$vo.address}<br>
                        老师：{$vo.teacher}
                    </td>
                    <td>{$vo.min_num}~{$vo.max_num}人</td>
                    <td>{$vo.sex_text}</td>
                    <td>{$vo.min_age}~{$vo.max_age}岁</td>
                    <td>{$vo.cost}元</td>
                    <td>{$vo.status_text}</td>
                    <td>{$vo.sign_num}</td>
                    <td>{$vo.open_status_text}</td>
                    <td>
                        <a class="btn btn-xs btn-primary" href="javascript:parent.openIframeLayer('{:url('sign_up/user_list',array('id'=>$vo['id']))}','报名人员列表',{area:['50%','60%']});">报名人员列表</a>

                        <a class="btn btn-xs btn-primary" href="javascript:parent.openIframeLayer('{:url('sign_up/timetable',array('id'=>$vo['id']))}','课程表',{area:['50%','60%']});">课程表</a>

                        <if $vo.status == 1>
                            <a href="{:url('sign_up/start_sign',array('id'=>$vo['id']))}" class="btn btn-xs btn-primary js-ajax-dialog-btn" data-msg="确定开启报名吗？">开启报名</a>
                        </if>
                        <if $vo.status == 2>
                            <a href="{:url('sign_up/end_sign',array('id'=>$vo['id']))}" class="btn btn-xs btn-primary js-ajax-dialog-btn" data-msg="确定结束报名吗？">结束报名</a>
                        </if>
                        <if $vo.status == 1 || $vo.status == 2>
                            <a href="{:url('sign_up/cancel_sign',array('id'=>$vo['id']))}" class="btn btn-xs btn-primary js-ajax-dialog-btn" data-msg="确定取消课程吗？">取消课程</a>
                        </if>

                        <if $vo.status == 3>
                            <if $vo.open_status == 1>
                                <a href="{:url('sign_up/open_course',array('id'=>$vo['id']))}" class="btn btn-xs btn-primary js-ajax-dialog-btn" data-msg="确定安装开启报名吗？">开启课程</a>
                            </if>
                            <if $vo.open_status == 2>
                                <a href="{:url('sign_up/end_course',array('id'=>$vo['id']))}" class="btn btn-xs btn-primary js-ajax-dialog-btn" data-msg="确定安装开启报名吗？">结束课程</a>
                            </if>
                        </if>

                        <a class="btn btn-xs btn-primary" href='{:url("sign_up/edit",array("id"=>$vo["id"]))}'>{:lang('EDIT')}</a>
                        <a class="btn btn-xs btn-danger js-ajax-delete" href='{:url("sign_up/delete",array("id"=>$vo["id"]))}'>{:lang('DELETE')}</a>
                    </td>
                </tr>
            </foreach>
            </tbody>
        </table>
        <div class="pagination">{$page}</div>
    </form>
</div>
<script src="__STATIC__/js/admin.js"></script>
</body>
</html>